import random

import numpy as np
import tensorflow
from keras.layers import LSTM, Dense, Dropout
from keras.models import Sequential
from tensorflow import keras

x_train = np.random.random((100, 10))
y_train = np.random.random((100, 10)) + x_train * 2.5 + 2

x_test = np.random.random((40, 10))
y_test = x_test * 2.5 + 2

print(x_train)
print(y_train)

model = Sequential()
model.add(Dense(512, input_shape=(10,), activation='relu' ))
model.add(Dropout(0.4))
model.add(Dense(10, activation='relu' ))
model.add(Dropout(0.5))

model.compile(loss=keras.losses.categorical_crossentropy,
              optimizer=tensorflow.keras.optimizers.Adadelta(), metrics=['accuracy'])

model.fit(
    x_train, y_train,
    batch_size=10,
    epochs=25,
    verbose=1,
    validation_data=(x_test, y_test)
)

score = model.evaluate(x_test, y_test)
print("Test loss", score[0])
print("Test acc", score[0])




# x_train = np.random.random((100, 4, 8))
# y_train = np.random.random((100, 10))
#
# x_val = np.random.random((100, 4, 8))
# y_val = np.random.random((100, 10))
#
#
# model = Sequential()
#
#
# # add a sequence of vectors of dimension 16
# model.add(LSTM(16, return_sequences=True))
# model.add(Dense(10, activation='softmax'))
#
# model.compile(
#     loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy']
# )
#
# model.fit(x_train, y_train, batch_size=32, epochs=5, validation_data=(x_val, y_val))
